﻿using System;
using UnityEngine.InputSystem;

namespace Inputs
{
    public class UIInput : GameInput<UIInput>, GameInputAction.IUIActions
    {
        public Action OpenSetPanelAction;

        private void OnEnable()
        {
            InputActions.UI.Enable();
            InputActions.UI.SetCallbacks(this);
        }

        private void OnDisable()
        {
            InputActions.UI.Disable();
        }

        public void OnOpenSetPanel(InputAction.CallbackContext context)
        {
            if (context.phase == InputActionPhase.Canceled)
                OpenSetPanelAction?.Invoke();
        }
    }
}